package org.jackysoft.interceptor;

import java.lang.reflect.Method;
import java.util.Collection;

import com.opensymphony.xwork2.ActionInvocation;

public class SortInterceptor extends AbstractInterceptor {

	/**
	 * 
	 */
	private static final long serialVersionUID = 3950479990539308392L;

	@Override
	public String intercept(ActionInvocation arg0) throws Exception {
		super.intercept(arg0);
		
		Method sort = service.getClass().getMethod("sorted",Collection.class);
	    sort.invoke(service, beans);
	    
		return arg0.invoke();
	}
    
}
